package com.invoicing.Service;

import com.invoicing.dao.OrderItemMapper;
import com.invoicing.entity.Order;
import com.invoicing.entity.OrderItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderitemService {
    @Autowired
    private OrderItemMapper orderItemMapper;

    public int insert(List<OrderItem> orderItem){ return orderItemMapper.insertOrderItem(orderItem);}

    public List<OrderItem> getAll(int id){return orderItemMapper.selectByOrderId(id);}

    public List<OrderItem> getByDate(Date date){return orderItemMapper.selectByDate(date);}

    public float getAllOrderCost(int id){return orderItemMapper.allOrderCost(id);}

    public int getAllOrderCount(int id){return orderItemMapper.allOrderCount(id);}
}
